FROM registry.cn-shanghai.aliyuncs.com/lianbin/idata-scheduler:v2.5

COPY jdk-8u371-linux-x64.tar /opt/
COPY spark3-k8s.tar /usr/
COPY flink-k8s.tar /usr/
COPY kube.tar /root/
RUN cd /root && tar -xvf kube.tar && rm -f kube.tar
RUN cd /opt && tar -xvf jdk-8u371-linux-x64.tar && rm -f jdk-8u371-linux-x64.tar

ENV JAVA_HOME="/opt/jdk1.8.0_281"
ENV PATH="${JAVA_HOME}/bin:$PATH"
ENV HDP_VERSION="3.1.5.0-152"

RUN  cd /usr && tar -xvf spark3-k8s.tar && rm -f spark3-k8s.tar

RUN  cd /usr && tar -xvf flink-k8s.tar && rm -f flink-k8s.tar.tar

ENV SPARK3_BINARY="/usr/hdp/3.1.5.0-152/spark3/bin/spark-submit"
ENV FLINK_BINARY="/usr/hdp/3.1.5.0-152/flink-1.13.6/bin/flink"
ENV LOGSTASH_BINARY="/opt/logstash/bin/logstash"

WORKDIR ${AIRFLOW_HOME}

ADD spark3/spark-env.sh  /usr/hdp/3.1.5.0-152/spark3/conf/spark-env.sh
ADD spark3/log4j.properties  /usr/hdp/3.1.5.0-152/spark3/conf/log4j.properties
ADD spark3/spark-defaults.conf  /usr/hdp/3.1.5.0-152/spark3/conf/spark-defaults.conf
ADD spark3/hive-site.xml  /usr/hdp/3.1.5.0-152/spark3/conf/hive-site.xml

ADD flink/flink-conf.yaml /usr/hdp/3.1.5.0-152/flink-1.13.6/conf/flink-conf.yaml
ADD flink/log4j.properties /usr/hdp/3.1.5.0-152/flink-1.13.6/conf/log4j.properties
ADD flink/log4j-session.properties /usr/hdp/3.1.5.0-152/flink-1.13.6/conf/log4j-session.properties
ADD flink/logback.xml /usr/hdp/3.1.5.0-152/flink-1.13.6/conf/logback.xml
ADD flink/logback-session.xml /usr/hdp/3.1.5.0-152/flink-1.13.6/conf/logback-session.xml

ADD startup.sh ${AIRFLOW_HOME}/startup.sh
ADD hosts /etc/hosts
ADD sssd.conf /etc/sssd/sssd.conf

RUN chmod 600 /etc/sssd/sssd.conf && chmod 744 ${AIRFLOW_HOME}/startup.sh















